<fieldset>
    <legend>条件搜索</legend>
    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get"  autocomplete="off">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">订单号</label>
            <div class="layui-input-inline">
                <input name="code" value="{$Think.get.code|default=''}" placeholder="请输入订单号" class="layui-input">
            </div>          
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">所属产品分类</label>
            <div class="layui-input-inline">
                <select class="layui-select" lay-search name="product_class" lay-filter="product_class_id">
                    {foreach $product_class_op as $k=>$v}
                    {eq name='Think.get.product_class' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">所属产品</label>
            <div class="layui-input-inline">
                <select class="layui-select" lay-search name="product_id">
                    {foreach $product_op as $k=>$v}
                    {eq name='Think.get.product_id' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">所属店铺</label>
            <div class="layui-input-inline">
                <select class="layui-select" lay-search name="shop_id">
                    {foreach $shop_op as $k=>$v}
                    {eq name='Think.get.shop_id' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">下单日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="create_order_at" value="{$Think.get.create_order_at|default=''}" placeholder="请选择下单日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">截止发货日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="delivery_at" value="{$Think.get.delivery_at|default=''}" placeholder="请选择截止发货日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">画手</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="painter">
                    {foreach $painter_op as $k=>$v}
                    {eq name='Think.get.painter' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">发画手日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="send_painter_at" value="{$Think.get.send_painter_at|default=''}" placeholder="请选择发画手日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">画手姓名</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="painter_name">
                    {foreach $painter_name_op as $k=>$v}
                    {eq name='Think.get.painter_name' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">客服沟通情况</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="kefu_exchange">
                    {foreach $kefu_exchange_op as $k=>$v}
                    {eq name='Think.get.kefu_exchange' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <!--<div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否PS排版</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="is_ps">
                    {foreach $is_ps_op as $k=>$v}
                    {eq name='Think.get.is_ps' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>-->
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制版状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="is_print">
                    {foreach $is_print_op as $k=>$v}
                    {eq name='Think.get.is_print' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制版者姓名</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="print_name">
                    {foreach $print_name_op as $k=>$v}
                    {eq name='Think.get.print_name' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>          
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制版完成日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="print_end_at" value="{$Think.get.print_end_at|default=''}" placeholder="请选择制版完成日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制版标记</label>
            <div class="layui-input-inline">
                <input name="print_mark" value="{$Think.get.print_mark}" placeholder="请输入制版标记" class="layui-input">
            </div>          
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制作情况</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="make_status">
                    {foreach $make_status_op as $k=>$v}
                    {eq name='Think.get.make_status' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制作者姓名</label>
            <div class="layui-input-inline">
                <!--<input name="maker_name" value="{$Think.get.maker_name|default=''}" placeholder="请输入制作者姓名" class="layui-input">-->
                <select class="layui-select" name="maker_name">
                    {foreach $maker_name_op as $k=>$v}
                    {eq name='Think.get.maker_name' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>          
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">制作完成日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="make_end_at" value="{$Think.get.make_end_at|default=''}" placeholder="请选择制作完成日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否质检</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="detection">
                    {foreach $detection_op as $k=>$v}
                    {eq name='Think.get.detection' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">打包状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="pack">
                    {foreach $pack_op as $k=>$v}
                    {eq name='Think.get.pack' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">发货状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="delivery">
                    {foreach $delivery_op as $k=>$v}
                    {eq name='Think.get.delivery' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">发货人</label>
            <div class="layui-input-inline">
                <!--<input name="pack_name" value="{$Think.get.pack_name|default=''}" placeholder="请输入打包者姓名" class="layui-input">-->
                <select class="layui-select" name="delivery_name">
                    {foreach $delivery_name_op as $k=>$v}
                    {eq name='Think.get.delivery_name' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>          
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">发货日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="delivery_real_at" value="{$Think.get.delivery_real_at|default=''}" placeholder="请选择发货日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否点发货</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="delivery_click">
                    {foreach $delivery_click_op as $k=>$v}
                    {eq name='Think.get.delivery_click' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <!--<div class="layui-form-item layui-inline">
            <label class="layui-form-label">耗损状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="loss">
                    {foreach $loss_op as $k=>$v}
                    {eq name='Think.get.loss' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>-->
        
        
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">客户是否发图</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="custom_pic">
                    {foreach $custom_pic_op as $k=>$v}
                    {eq name='Think.get.custom_pic' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否加急</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="urgent">
                    {foreach $urgent_op as $k=>$v}
                    {eq name='Think.get.urgent' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">下单日期排序</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="order_sort">
                    {foreach $order_sort_op as $k=>$v}
                    {eq name='Think.get.order_sort' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <!--<div class="layui-form-item layui-inline">
            <label class="layui-form-label">打印标签</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="print_label">
                    {foreach $print_label_op as $k=>$v}
                    {eq name='Think.get.print_label' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>-->
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">整理日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="arrange_at" value="{$Think.get.arrange_at|default=''}" placeholder="请选择整理日期" class="layui-input">
            </div>
        </div>      
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">安排制作日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="make_plan_at" value="{$Think.get.make_plan_at|default=''}" placeholder="请选择安排制作日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">绘画日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="draw_at" value="{$Think.get.draw_at|default=''}" placeholder="请选择绘画日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">订单整理人</label>
            <div class="layui-input-inline">
                <select class="layui-select" lay-search name="organizer">
                    {foreach $organizer_op as $k=>$v}
                    {eq name='Think.get.organizer' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">核对日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="check_at" value="{$Think.get.check_at|default=''}" placeholder="请选择核对日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否补发</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="reissue">
                    {foreach $reissue_op as $k=>$v}
                    {eq name='Think.get.reissue' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">衣服类型</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="clothing">
                    {foreach $clothing_op as $k=>$v}
                    {eq name='Think.get.clothing' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">是否发邮箱</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="is_sendemail">
                    {foreach $is_sendemail_op as $k=>$v}
                    {eq name='Think.get.is_sendemail' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">发邮箱日期</label>
            <div class="layui-input-inline">
                <input data-date-range name="sendemail_at" value="{$Think.get.sendemail_at|default=''}" placeholder="请选择发邮箱日期" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">收货国家</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="receiving_country">
                    {foreach $receiving_country_op as $k=>$v}
                    {eq name='Think.get.receiving_country' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-inline">
                <input data-date-range name="create_at" value="{$Think.get.create_at|default=''}" placeholder="请选择创建时间" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">更新时间</label>
            <div class="layui-input-inline">
                <input data-date-range name="update_at" value="{$Think.get.update_at|default=''}" placeholder="请选择更新时间" class="layui-input">
            </div>
        </div>
        
        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
        </div>
        <input type="hidden" name="page" class="page" value="1">
    </form>
</fieldset>

<script>
window.form.render(); 
  
  
  form.on('select(product_class_id)', function(data){
      
        console.log(data.value); //得到被选中的值
        
        if(data.value){
            $.form.load('{:url("get_product_list")}', {product_class : data.value}, "post", function (ret) {
                
                
                var html = ' <option style="display: none" value="">-- 全部产品 --</option>'
				$.each(ret.data,function (i,v){
					console.log(v)
					html += ' <option value="'+ v.id +'">'+ v.name + '</option>'
				})


				$("[name='product_id']").html(html);
                
                form.render();
                return false;
            })
        }else{
        	$.form.load('{:url("get_product_list")}', {product_class : data.value}, "post", function (ret) {
                
                
                var html = ' <option style="display: none" value="">-- 全部产品 --</option>'
				$.each(ret.data,function (i,v){
					console.log(v)
					html += ' <option value="'+ v.id +'">'+ v.name + '</option>'
				})

				$("[name='product_id']").html(html);
                
                form.render();
                return false;
            })
        }
 
        form.render();
    });
</script>

